package com.slz3.business.module.orderManagement.ordOrder.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.orderManagement.ordOrder.domain.OrdOrder;
import com.slz3.business.module.orderManagement.ordOrder.domain.OrdOrderCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class OrdOrderResController {

    static Mono<ServerResponse> add(ServerRequest req, OrdOrder ordOrder) {
        if (OrdOrderResUnsafeValid.add(req, ordOrder)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.add_$OrdOrderUpdateLock(req, ordOrder);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        if (OrdOrderResUnsafeValid.delete(req, ordOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.delete_$OrdOrderUpdateLock(req, ordOrderCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, OrdOrder ordOrder) {
        if (OrdOrderResUnsafeValid.modify(req, ordOrder)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.modify_$OrdOrderUpdateLock(req, ordOrder);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (OrdOrderResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (OrdOrderResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.info_$OrdOrderUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (OrdOrderResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        //
        if (OrdOrderResUnsafeValid.auditSubmit(req, ordOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.auditSubmit_$OrdOrderUpdateLock(req, ordOrderCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        if (OrdOrderResUnsafeValid.audit(req, ordOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.audit_$OrdOrderUpdateLock(req, ordOrderCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        if (OrdOrderResUnsafeValid.auditReject(req, ordOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.auditReject_$OrdOrderUpdateLock(req, ordOrderCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        if (OrdOrderResUnsafeValid.usingEnable(req, ordOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.usingEnable_$OrdOrderUpdateLock(req, ordOrderCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        if (OrdOrderResUnsafeValid.usingDisable(req, ordOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderResAtomic.usingDisable_$OrdOrderUpdateLock(req, ordOrderCondition);
        }
    }

}
